package com.lcxw.hxzb.friendcircle.project.system.service.impl;

import java.util.List;
import com.lcxw.hxzb.friendcircle.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lcxw.hxzb.friendcircle.project.system.mapper.YwpdHistoryMapper;
import com.lcxw.hxzb.friendcircle.project.system.domain.YwpdHistory;
import com.lcxw.hxzb.friendcircle.project.system.service.IYwpdHistoryService;

/**
 * 用户足迹Service业务层处理
 *
 * @author theme
 * @date 2020-07-28
 */
@Service
public class YwpdHistoryServiceImpl implements IYwpdHistoryService {

    @Autowired
    private YwpdHistoryMapper ywpdHistoryMapper;

    /**
     * 查询用户足迹
     *
     * @param historyId 用户足迹ID
     * @return 用户足迹
     */
    @Override
    public YwpdHistory selectYwpdHistoryById(Long historyId) {
        return ywpdHistoryMapper.selectYwpdHistoryById(historyId);
    }

    /**
     * 查询用户足迹列表
     *
     * @param ywpdHistory 用户足迹
     * @return 用户足迹
     */
    @Override
    public List<YwpdHistory> selectYwpdHistoryList(YwpdHistory ywpdHistory) {
        return ywpdHistoryMapper.selectYwpdHistoryList(ywpdHistory);
    }

    /**
     * 新增用户足迹
     *
     * @param ywpdHistory 用户足迹
     * @return 结果
     */
    @Override
    public int insertYwpdHistory(YwpdHistory ywpdHistory) {
        ywpdHistory.setCreateTime(DateUtils.getNowDate());
        return ywpdHistoryMapper.insertYwpdHistory(ywpdHistory);
    }

    /**
     * 修改用户足迹
     *
     * @param ywpdHistory 用户足迹
     * @return 结果
     */
    @Override
    public int updateYwpdHistory(YwpdHistory ywpdHistory) {
        return ywpdHistoryMapper.updateYwpdHistory(ywpdHistory);
    }

    /**
     * 批量删除用户足迹
     *
     * @param historyIds 需要删除的用户足迹ID
     * @return 结果
     */
    @Override
    public int deleteYwpdHistoryByIds(Long[] historyIds) {
        return ywpdHistoryMapper.deleteYwpdHistoryByIds(historyIds);
    }

    /**
     * 删除用户足迹信息
     *
     * @param historyId 用户足迹ID
     * @return 结果
     */
    @Override
    public int deleteYwpdHistoryById(Long historyId) {
        return ywpdHistoryMapper.deleteYwpdHistoryById(historyId);
    }

    @Override
    public List<YwpdHistory> selectYwpdHistory(YwpdHistory ywpdHistory) {
        return ywpdHistoryMapper.selectYwpdHistory(ywpdHistory);
    }
}
